<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>基本信息表(所有人员)</title>
    <link rel="stylesheet" href="../../../css/common/bootstrap.min.css">
    <link rel="stylesheet" href="../../../css/admin/download/font_2801350_hw9pyy8c125/iconfont.css">
    <script src="../../../js/common/jquery-1.12.4.js"></script>
    <!-- 必须先引入vue，  后使用element-ui -->
    <script src="../../../js/common/vue.js"></script>
    <!--引入 element-ui 的样式，-->
    <link rel="stylesheet" href="../../../css/common/element.css">
    <!-- 引入element 的组件库-->
    <script src="../../../js/common/element.js"></script>
    <script>
        $(function() {
            //通过点击最上面的全选框，它的选中状态决定后面复选框的选中状态
            $("#all").click(function() {
                $("#tb input").prop("checked", $(this).prop("checked"));
            });

            //后面的复选框点击后，判断是否全部都选中，如果都选中，最上面的全选框自动勾上
            $("#tb input").click(function() {
                if ($("#tb input:checked").length == $("#tb input").length) {
                    $("#all").prop("checked", true);
                } else {
                    $("#all").prop("checked", false);
                }
            });

            $("#ID").bind("input propertychange", function() {
                var text = $("#ID").val();
                if (text != '') { //若输入框1的内容不为空，则输入框2不可用
                    $("#Name").attr("disabled", "disabled"); //设置输入框2不可用
                    $("#peopleId").attr("disabled", "disabled");
                } else {
                    $("#Name").removeAttr("disabled"); //移除不可用的属性
                    $("#peopleId").removeAttr("disabled");
                }
            })
            $("#Name").bind("input propertychange", function() {
                var text = $("#Name").val();
                if (text != '') { //若输入框1的内容不为空，则输入框2不可用
                    $("#ID").attr("disabled", "disabled"); //设置输入框2不可用
                    $("#peopleId").attr("disabled", "disabled");
                } else {
                    $("#ID").removeAttr("disabled"); //移除不可用的属性
                    $("#peopleId").removeAttr("disabled");
                }
            })
            $("#peopleId").bind("input propertychange", function() {
                var text = $("#peopleId").val();
                if (text != '') { //若输入框1的内容不为空，则输入框2不可用
                    $("#ID").attr("disabled", "disabled");
                    $("#Name").attr("disabled", "disabled");
                } else {
                    $("#ID").removeAttr("disabled"); //移除不可用的属性
                    $("#Name").removeAttr("disabled");
                }
            })
        });
    </script>
    <style>
        th {
            text-align: center;
        }
    </style>
</head>

<body>
    <div style="width: 100%;height: 20px;"></div>
    <form class="form-inline" style="text-align: center;">
        <div class="form-group">
            <label for="ID">ID</label>
            <input type="text" class="form-control" id="ID" placeholder="请输入人员ID">
            <label for="Name">姓名</label>
            <input type="text" class="form-control" id="Name" placeholder="请输入姓名">
            <label for="peopleId">身份证号</label>
            <input type="text" class="form-control" id="peopleId" placeholder="请输入身份证号">
        </div>
        <button type="submit" class="btn btn-default"><i class="iconfont"
                style="font-size: 14px;color: #3E8EF7;">&#xe660;</i></button>
    </form>
    <div style="width: 100%;height: 20px;"></div>
    <table class="table table-bordered" style="text-align: center;">
        <thead id="th">
            <tr>
                <th><input type="checkbox" id="all"></th>
                <th>人员id</th>
                <th>头像</th>
                <th>身份证号</th>
                <th>姓名</th>
                <th>性别</th>
                <th>年龄</th>
                <th>生日</th>
                <th>电话</th>
                <th>注册时间</th>
                <th>邮箱</th>
                <th>是否为管理员</th>
            </tr>
        </thead>
        <tbody id="tb">

        </tbody>


    </table>
    <div style="float: right;margin-right: 20px;">
        <div style="float: left;height: 80px;line-height: 80px;margin-right: 20px;">共&nbsp;4&nbsp;条记录</div>
        <div style="float: left;height: 80px;line-height: 80px;margin-right: 20px;">8条&nbsp;/&nbsp;页</div>
        <div id="app" style="float: left;" onclick="page()">
            <el-pagination background layout="prev, pager, next" :total="100" style="margin-top: 23px;">
            </el-pagination>
        </div>
    </div>
    <script>
        new Vue().$mount('#app');

        function page() {
            let active = document.getElementsByClassName("active")[0];
            // 点击返回页码数
            // console.log(active.innerText);
            alert("当前第" + active.innerText + "页")
            return parseInt(active.innerText);
        }
        let people_list = [{
            "people_id": 1,
            "head_img": "../../../images/admin/xm.jpg",
            "people_num": "320621200008110032",
            "name": "吴京泽",
            "sex": "男",
            "age": 22,
            "birthday": "2000-08-11",
            "tel": "18936093161",
            "people_time": "2011-11-11",
            "e_mail": "1556370540@qq.com",
            "if_admin": "是"
        }, {
            "people_id": 1,
            "head_img": "../../../images/admin/xm.jpg",
            "people_num": "320621200008110032",
            "name": "吴京泽",
            "sex": "男",
            "age": 22,
            "birthday": "2000-08-11",
            "tel": "18936093161",
            "people_time": "2011-11-11",
            "e_mail": "1556370540@qq.com",
            "if_admin": "是"
        }, {
            "people_id": 1,
            "head_img": "../../../images/admin/xm.jpg",
            "people_num": "320621200008110032",
            "name": "吴京泽",
            "sex": "男",
            "age": 22,
            "birthday": "2000-08-11",
            "tel": "18936093161",
            "people_time": "2011-11-11",
            "e_mail": "1556370540@qq.com",
            "if_admin": "是"
        }, {
            "people_id": 1,
            "head_img": "../../../images/admin/xm.jpg",
            "people_num": "320621200008110032",
            "name": "吴京泽",
            "sex": "男",
            "age": 22,
            "birthday": "2000-08-11",
            "tel": "18936093161",
            "people_time": "2011-11-11",
            "e_mail": "1556370540@qq.com",
            "if_admin": "是"
        }, {
            "people_id": 1,
            "head_img": "../../../images/admin/xm.jpg",
            "people_num": "320621200008110032",
            "name": "吴京泽",
            "sex": "男",
            "age": 22,
            "birthday": "2000-08-11",
            "tel": "18936093161",
            "people_time": "2011-11-11",
            "e_mail": "1556370540@qq.com",
            "if_admin": "是"
        }]

        let tb = document.getElementById("tb");
        let str = "";
        for (let i = 0; i < people_list.length; i++) {
            str += '<tr>';
            str += '<td><input type="checkbox"></td>';
            str += '<td>' + people_list[i].people_id + '</td>';
            str += '<td><img src="' + people_list[i].head_img + '" style="height: 50px;width: 50px;"></td>';
            str += '<td>' + people_list[i].people_num + '</td>';
            str += '<td>' + people_list[i].name + '</td>';
            str += '<td>' + people_list[i].sex + '</td>';
            str += '<td>' + people_list[i].age + '</td>';
            str += '<td>' + people_list[i].birthday + '</td>';
            str += '<td>' + people_list[i].tel + '</td>';
            str += '<td>' + people_list[i].people_time + '</td>';
            str += '<td>' + people_list[i].e_mail + '</td>';
            str += '<td>' + people_list[i].if_admin + '</td>';
            str += '</tr>';
        }
        tb.innerHTML = str;
    </script>
</body>

</html>